package com.shiyi.controller;

import cn.hutool.core.date.DatePattern;
import cn.hutool.core.date.DateUtil;
import com.shiyi.service.pdf.OpenPdfService;
import com.shiyi.service.pdf.PoiWordService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.Date;

@RestController
@RequestMapping("interface/CreatePdf")
public class CreatePdfController {

//    @Resource
//    CreatePdfService createPdfService;


    @Resource
    OpenPdfService openPdfService;
    @Resource
    PoiWordService poiWordService;
    @RequestMapping("createPdfFile")
    public Boolean createPdfFile() {
        return false;
//        return createPdfService.createPdfFile();
    }


    @RequestMapping("/openpdfTest")
    public void openpdfTest() {
        openPdfService.openPdf("测试"+ DateUtil.format(new Date(), DatePattern.PURE_DATETIME_FORMAT));

    }

    @RequestMapping("/wordTest")
    public void wordTest() {
//        poiWordService.write2Docx();
        poiWordService.writeWordBanch();
    }
}